<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.xea.model.Channel"%>
<%@include file="/inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
	function del(){
		var url="${basepath}/channel?m=del&id=${channel.id}&parentId=${channel.id}";
		jConfirm("确认要执行操作吗？",null,function(r) {
		 	if(r) {
				$.ajax({
		        	type: "POST",
		        	url: url,
		        	dataType: "json",
		        	success: function(data){
		        		if(data!=null){
							jError(data.msg);
						}else{
							jSuccess("删除成功!", null, function(r){
				            	parent.frames["channelleft"].location.href="${basepath}/channel?m=search";
								parent.frames["channelmain"].location.href="${basepath}/inner/welcome.jsp";
				            });
		            	}
		        	},
		        	error: function(data){
		        	}
		    	});
			}
		});
	}
	function update(){
  		var url="${basepath}/channel?m=findById&_url=inner/admin/channel/update.jsp&id=${channel.id}&channelname=${channel.parentId==0?'分类管理':chan.name}";
		window.location.href=url;
	}
</script>
</head>
<body>
  <form id="channelform" name="channelform">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  	<tr>
      <td height="30">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
        	<td height="24" bgcolor="#353c44">
        	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          	    <tr>
            	  <td>
            	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              		  <tr>
                	    <td width="6%" height="19" valign="bottom"><div align="center"><img src="${basepath}/res/image/tb.gif" width="14" height="14" /></div></td>
                	    <td width="94%" valign="bottom"><span class="STYLE1"> 类别详情</span></td>
              		  </tr>
            	    </table>
            	  </td>
            	  <td>
            	    <div align="right"><span class="STYLE1">
            	      <c:if test="${param.id==0}">
              	  	  <span style="cursor: pointer;" title="添加子类别" onclick="window.location.href='${basepath}/inner/admin/channel/add.jsp?type=0&channelname=${param.id==0?'分类管理':channel.name}'"><img src="${basepath}/res/image/album_add.gif" width="18" height="18"/> 添加子类别  </span> &nbsp; 
              		  </c:if>
              		  <c:if test="${param.id!=0}">
              		  <%
						Channel ch = (Channel)request.getAttribute("channel");
						int u = (ch.getType()==0 && ch.getParentId()==0?ch.getId():ch.getType());
					  %>
              		  <span style="cursor: pointer;" title="添加子类别" onclick="window.location.href='${basepath}/inner/admin/channel/add.jsp?type=<%=u %>&parentId=${channel.id}&channelname=${channel.name}'"><img src="${basepath}/res/image/album_add.gif" width="18" height="18"/> 添加子类别  </span> &nbsp; 
              		  <span style="cursor: pointer;" title="添加同级类别" onclick="window.location.href='${basepath}/inner/admin/channel/add.jsp?type=${channel.type}&parentId=${channel.parentId}&channelname=${channel.parentId==0?'分类管理':chan.name}'"><img src="${basepath}/res/image/album_add.gif" width="18" height="18"/> 添加同级类别  </span> &nbsp; 
              		  <span title="删除类别" style="cursor: pointer;" onclick="del();"><img src="${basepath}/res/image/album_remove.gif" width="18" height="18"/> 删除类别</span>    &nbsp;&nbsp;
              		  <span title="编辑类别" style="cursor: pointer;" onclick="update();"><img src="${basepath}/res/image/album_edit.gif" width="18" height="18"/> 编辑类别 &nbsp;</span>
              		  <span class="STYLE1"> &nbsp;</span>
              		  </c:if></span>
               	    </div>
              	  </td>
          	    </tr>
        	  </table>
            </td>
      	  </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
       	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">上级类别：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;${channel.parentId==0?'分类管理':chan.name}</td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">类别名称：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;${channel.name}</td>
      	  </tr>
      	  <tr>
        	<td width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">类别备注：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<textarea rows="5" cols="40" style="margin-top: 5px;margin-bottom: 5px;" title="备注" readonly="readonly">${channel.remark}</textarea> </td>
      	  </tr>
  		</table>
  	  </td>
  	</tr>
  </table>
  </form>
</body>

